package com.bsj.travel.def.common.DTO.web;

import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/***
 * @description PageDTO
 * @author LiJiaXin
 * @version 1.0.0
 * @time 2024/1/10 11:03
 **/
@Data
public class PageDTO {

    /**
     * 页大小
     */
    @NotNull(message = "页大小不能为空")
    @Min(value = 1, message = "页大小错误")
    private Integer pageSize;

    /**
     * 页码数
     */
    @NotNull(message = "页码数不能为空")
    @Min(value = 1, message = "页码数错误")
    private Integer pageNumber;

    public void initPageNumber() {
        pageNumber = (pageNumber - 1) * pageSize;
    }

}
